//
//  PreferenceViewController.m
//  Baidu
//
//  Created by C_HAO on 15/4/7.
//  Copyright (c) 2015年 C_HAO. All rights reserved.
//

#import "PreferenceViewController.h"
#import "AppDelegate.h"
#import "UserPreferences.h"

@interface PreferenceViewController ()

@property (nonatomic, retain)IBOutlet NSButton *baiduButton;
@property (nonatomic, retain)IBOutlet NSButton *youdaoButton;

@end

@implementation PreferenceViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do view setup here.
    [_baiduButton setState:([AppDelegate appDelegate].preferences.baidu)];
    [_youdaoButton setState:([AppDelegate appDelegate].preferences.youdao)];
}

- (IBAction)baidu:(id)sender
{
    [AppDelegate appDelegate].preferences.baidu = _baiduButton.state;
}

- (IBAction)youdao:(id)sender
{
    [AppDelegate appDelegate].preferences.youdao = _youdaoButton.state;
}


@end
